using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace HX.Model.Xcode.HXDB
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindIndex("PK_AppFavorites", true, "Id")]
    [BindTable("T_App_Flight_Favorites", Description = "", ConnName = "HXDB", DbType = DatabaseType.SqlServer)]
    public partial class TAppFlightFavorites : ITAppFlightFavorites
    {
        #region 属性
        private String _Id;
        /// <summary></summary>
        [DisplayName("Id")]
        [DataObjectField(true, false, false, 100)]
        [BindColumn("Id", "", "nvarchar(100)")]
        public String Id { get => _Id; set { if (OnPropertyChanging(__.Id, value)) { _Id = value; OnPropertyChanged(__.Id); } } }

        private String _LoginName;
        /// <summary></summary>
        [DisplayName("LoginName")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn("LoginName", "", "nvarchar(100)")]
        public String LoginName { get => _LoginName; set { if (OnPropertyChanging(__.LoginName, value)) { _LoginName = value; OnPropertyChanged(__.LoginName); } } }

        private String _TypeId;
        /// <summary></summary>
        [DisplayName("TypeId")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn("TypeId", "", "nvarchar(100)")]
        public String TypeId { get => _TypeId; set { if (OnPropertyChanging(__.TypeId, value)) { _TypeId = value; OnPropertyChanged(__.TypeId); } } }

        private Int32 _Type;
        /// <summary></summary>
        [DisplayName("Type")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("Type", "", "int")]
        public Int32 Type { get => _Type; set { if (OnPropertyChanging(__.Type, value)) { _Type = value; OnPropertyChanged(__.Type); } } }

        private String _Source;
        /// <summary></summary>
        [DisplayName("Source")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Source", "", "nvarchar(50)")]
        public String Source { get => _Source; set { if (OnPropertyChanging(__.Source, value)) { _Source = value; OnPropertyChanged(__.Source); } } }

        private DateTime _CreateTime;
        /// <summary></summary>
        [DisplayName("CreateTime")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn("CreateTime", "", "datetime", Precision = 0, Scale = 3)]
        public DateTime CreateTime { get => _CreateTime; set { if (OnPropertyChanging(__.CreateTime, value)) { _CreateTime = value; OnPropertyChanged(__.CreateTime); } } }

        private Boolean _IsEnable;
        /// <summary></summary>
        [DisplayName("IsEnable")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("IsEnable", "", "bit")]
        public Boolean IsEnable { get => _IsEnable; set { if (OnPropertyChanging(__.IsEnable, value)) { _IsEnable = value; OnPropertyChanged(__.IsEnable); } } }

        private String _Expand;
        /// <summary></summary>
        [DisplayName("Expand")]
        [DataObjectField(false, false, true, 2000)]
        [BindColumn("Expand", "", "nvarchar(2000)")]
        public String Expand { get => _Expand; set { if (OnPropertyChanging(__.Expand, value)) { _Expand = value; OnPropertyChanged(__.Expand); } } }

        private String _Filter;
        /// <summary></summary>
        [DisplayName("Filter")]
        [DataObjectField(false, false, true, 2000)]
        [BindColumn("Filter", "", "nvarchar(2000)")]
        public String Filter { get => _Filter; set { if (OnPropertyChanging(__.Filter, value)) { _Filter = value; OnPropertyChanged(__.Filter); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.Id: return _Id;
                    case __.LoginName: return _LoginName;
                    case __.TypeId: return _TypeId;
                    case __.Type: return _Type;
                    case __.Source: return _Source;
                    case __.CreateTime: return _CreateTime;
                    case __.IsEnable: return _IsEnable;
                    case __.Expand: return _Expand;
                    case __.Filter: return _Filter;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.Id: _Id = Convert.ToString(value); break;
                    case __.LoginName: _LoginName = Convert.ToString(value); break;
                    case __.TypeId: _TypeId = Convert.ToString(value); break;
                    case __.Type: _Type = value.ToInt(); break;
                    case __.Source: _Source = Convert.ToString(value); break;
                    case __.CreateTime: _CreateTime = value.ToDateTime(); break;
                    case __.IsEnable: _IsEnable = value.ToBoolean(); break;
                    case __.Expand: _Expand = Convert.ToString(value); break;
                    case __.Filter: _Filter = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得TAppFlightFavorites字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field Id = FindByName(__.Id);

            /// <summary></summary>
            public static readonly Field LoginName = FindByName(__.LoginName);

            /// <summary></summary>
            public static readonly Field TypeId = FindByName(__.TypeId);

            /// <summary></summary>
            public static readonly Field Type = FindByName(__.Type);

            /// <summary></summary>
            public static readonly Field Source = FindByName(__.Source);

            /// <summary></summary>
            public static readonly Field CreateTime = FindByName(__.CreateTime);

            /// <summary></summary>
            public static readonly Field IsEnable = FindByName(__.IsEnable);

            /// <summary></summary>
            public static readonly Field Expand = FindByName(__.Expand);

            /// <summary></summary>
            public static readonly Field Filter = FindByName(__.Filter);

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得TAppFlightFavorites字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String Id = "Id";

            /// <summary></summary>
            public const String LoginName = "LoginName";

            /// <summary></summary>
            public const String TypeId = "TypeId";

            /// <summary></summary>
            public const String Type = "Type";

            /// <summary></summary>
            public const String Source = "Source";

            /// <summary></summary>
            public const String CreateTime = "CreateTime";

            /// <summary></summary>
            public const String IsEnable = "IsEnable";

            /// <summary></summary>
            public const String Expand = "Expand";

            /// <summary></summary>
            public const String Filter = "Filter";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface ITAppFlightFavorites
    {
        #region 属性
        /// <summary></summary>
        String Id { get; set; }

        /// <summary></summary>
        String LoginName { get; set; }

        /// <summary></summary>
        String TypeId { get; set; }

        /// <summary></summary>
        Int32 Type { get; set; }

        /// <summary></summary>
        String Source { get; set; }

        /// <summary></summary>
        DateTime CreateTime { get; set; }

        /// <summary></summary>
        Boolean IsEnable { get; set; }

        /// <summary></summary>
        String Expand { get; set; }

        /// <summary></summary>
        String Filter { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}